From: Jonas Dreßler Date: Sat, 28 Mar 2020 10:54:32 +0000 (+0100) Subject: keyboard: Run dispose manually on virtual input device when destroying X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~751^2^2~19 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=ba8210ea98a7acce5341e9677883f0640e023564;p=gnome-shell.git keyboard: Run dispose manually on virtual input device when destroying We want to make sure any buttons that are still pressed on the virtual input device used by the OSK are released immediately when destroying the OSK. Do this by calling run_dispose() on the destroy() function of the KeyboardController, which makes sure we don't have to wait for the garbage collection to dispose the object and a still pressed key remains being pressed until the GC kicks in. Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2287 Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/956 https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1141 --- diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index 7d56ef9c8..8b7f0f895 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -1868,6 +1868,10 @@ var KeyboardController = class { Main.inputMethod.disconnect(this._notifyContentPurposeId); Main.inputMethod.disconnect(this._notifyContentHintsId); Main.inputMethod.disconnect(this._notifyInputPanelStateId); + + // Make sure any buttons pressed by the virtual device are released + // immediately instead of waiting for the next GC cycle + this._virtualDevice.run_dispose(); } _onSourcesModified() {